// pages/component/nav-bar/nav-bar.js
Component({
options:{
  addGlobalClass:true,
  multipleSlots:true
},
externalClasses:['custom-class', 'title-class'],
data:{
  statusBarHeight:0
},
lifetimes:{
  attached(){
    console.log(1);
    const info= wx.getSystemInfoSync()
    console.log(info);
    this.setData({
      statusBarHeight:info.statusBarHeight
    })
  }
},
properties: {
  // 控制返回按钮是否显示
  back: Boolean,
  // 控制返回的步数
  delta: {
    type: Number,
    value: 1
  }
},
methods: {
  goBack(){
    wx.navigateBack(this.data.delta)
  }
}
})
